package com.action.schedule;

import com.db.schedule.*;

import java.io.*;
import java.util.*;
public class InputAction {
	private int sno;
	private int sabun;
	private String psubject;
	private String pcontent;
	private String pplace;
	private String sday;
	private String sday1;
	private String sday2;
	
	
	
	
	public int getSno() {
		return sno;
	}
	public void setSno(int sno) {
		this.sno = sno;
	}


	private ScheduleDAO scheduleDAO;
	

	
	public void setScheduleDAO(ScheduleDAO scheduleDAO) {
		this.scheduleDAO = scheduleDAO;
	}
	
	
	private int type;
	
	
	public void setSabun(int sabun) {
		this.sabun = sabun;
	}
	public void setPsubject(String psubject) {
		this.psubject = psubject;
	}
	public void setPcontent(String pcontent) {
		this.pcontent = pcontent;
	}
	public void setPplace(String pplace) {
		this.pplace = pplace;
	}
	public void setSday(String sday) {
		
		StringTokenizer st= new StringTokenizer(sday, "-");
		String sday0=st.nextToken();

		String sday1=st.nextToken();
				
		String sday2=st.nextToken();

		this.sday = sday0;
		this.sday1 =sday1;
		this.sday2 = sday2;
	}
		
	
	/*public void setEday(String eday) {
		
		StringTokenizer st = new StringTokenizer(eday, "-");

		String eday0=st.nextToken();

		String eday1=st.nextToken();
				
		String eday2=st.nextToken();
		this.eday = eday0;
		this.eday1 = eday1;
		this.eday2 = eday2;
	}
*/		
	
	
	public void setType(int type) {
		this.type = type;
	}
	public String insert()throws Exception
	{
		
		ScheduleVO vo=new ScheduleVO();
		vo.setSabun(sabun);
		vo.setPsubject(psubject);
		vo.setPcontent(pcontent);
		vo.setPplace(pplace);
		vo.setSday(sday);
		vo.setSday1(sday1);
		vo.setSday2(sday2);
		
		vo.setType(type);
		
		
		scheduleDAO.ScheduleInsert(vo);
		return "success";
	}
	
	
	
	
	

}
